/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package server.process;

import java.util.Comparator;

/**
 *
 * @author Hoang
 */
public class CommentPhotoComparator implements Comparator<TopCommentPhoto> {

    public int compare(TopCommentPhoto o1, TopCommentPhoto o2) {
        if (o1.getTotalComment() > o2.getTotalComment()) {
            return 1;
        } else if (o1.getTotalComment() == o2.getTotalComment()) {
            return 0;
        } else {
            return -1;
        }
    }
}
